import fitz

def pdf_image():
	doc = fitz.open('test.pdf')

	print(doc.pageCount)
	for page in doc:
		page.get_pixmap().writeImage(f'page_{page.number}.png')